package org.example.Server.controller;


import lombok.extern.slf4j.Slf4j;
import org.example.Server.model.commen.Test;
import org.example.Server.service.TestService;
import org.example.Server.utils.ResultAPI;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("/test")
public class TestController {
    @Autowired
   TestService testService;

    @GetMapping("/hello")
    public String hello() {
        return "hello";
    }
    @GetMapping("/getTest")
    public ResultAPI getTest(@RequestParam String name,@RequestParam String password) {
        Test test = testService.test(name, password);
        return ResultAPI.success(test,"成功！！");
    }
}
